package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import java.util.List;
import java.util.Date;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;

/**
 * <p>
 * ${table.comment} 服务实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Transactional
@Service
<#if kotlin>
open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
	    
	    public boolean save( ${entity} ${entity?uncap_first}) {
			${entity?uncap_first}.setGmtCreate(new Date());
			return super.insert(${entity?uncap_first});
		}
	
		@Override
		public boolean update(${entity} ${entity?uncap_first}) {
			${entity?uncap_first}.setGmtModified(new Date());
			return super.updateById(${entity?uncap_first});
		}
		
		
		@Override
		public boolean deleteById(Long id) {
			return super.deleteById(id);
		}
	
		@Override
		public boolean deleteByIds(List<Long> ids) {
			if(null==ids||ids.isEmpty()){
				return false;
			}
			return super.deleteBatchIds(ids);
		}
}
<#else>
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {

	
	public boolean save( ${entity} ${entity?uncap_first}) {
		${entity?uncap_first}.setGmtCreate(new Date());
		return super.insert(${entity?uncap_first});
	}

	@Override
	public boolean update(${entity} ${entity?uncap_first}) {
		${entity?uncap_first}.setGmtModified(new Date());
		return super.updateById(${entity?uncap_first});
	}
	
	
	@Override
	public boolean deleteById(Long id) {
		return super.deleteById(id);
	}

	@Override
	public boolean deleteByIds(List<Long> ids) {
		if(null==ids||ids.isEmpty()){
			return false;
		}
		return super.deleteBatchIds(ids);
	}

}
</#if>
